
package com.anjiplus.template.gaea.business.modules.httppath.controller;

import com.anji.plus.gaea.annotation.Permission;
import com.anji.plus.gaea.bean.ResponseBean;
import com.anji.plus.gaea.curd.controller.GaeaBaseController;
import com.anji.plus.gaea.curd.service.GaeaBaseService;
import com.anjiplus.template.gaea.business.modules.httppath.controller.dto.HttpPathDto;
import com.anjiplus.template.gaea.business.modules.httppath.controller.param.HttpPathParam;
import com.anjiplus.template.gaea.business.modules.httppath.dao.entity.HttpPath;
import com.anjiplus.template.gaea.business.modules.httppath.service.HttpPathService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @desc 数据源 controller
* @website https://gitee.com/anji-plus/gaea
* @author Raod
* @date 2021-03-18 12:09:57.728203200
**/
@RestController

@Permission(code = "httpPath", name = "环境变量配置")
@RequestMapping("/httpPath")
public class HttpPathController extends GaeaBaseController<HttpPathParam, HttpPath, HttpPathDto> {

    @Autowired
    private HttpPathService httpPathService;

    @Override
    public GaeaBaseService<HttpPathParam, HttpPath> getService() {
        return httpPathService;
    }

    @Override
    public HttpPath getEntity() {
        return new HttpPath();
    }

    @Override
    public HttpPathDto getDTO() {
        return new HttpPathDto();
    }

    /**
     * 获取所有环境变量
     * @return
     */
    @GetMapping("/queryAllHttpPath")
    public ResponseBean queryAllDataSource() {
        return responseSuccessWithData(httpPathService.queryAllHttpPaths());
    }


}
